package com.mytaobao.main.firsttab.func.flashsale;

import android.content.Context;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.baseproject.adapter.ItemViewDelegate;
import com.baseproject.adapter.ViewHolder;
import com.mytaobao.R;
import com.mytaobao.util.Const;

/**
 * 淘抢购
 */

public class FlashSaleItemDelegate implements ItemViewDelegate<ItemFlashSaleData> {

    @Override
    public int getItemViewLayoutId() {
        return R.layout.adapter_firsttab_flash_sale;
    }

    @Override
    public int getItemViewType() {
        return Const.TYPE_FLASH_SALE;
    }

    @Override
    public void convert(ViewHolder holder, int position) {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return false;
    }

    @Override
    public ViewHolder createViewHolder(Context context, ViewGroup parent) {
        View itemView = LayoutInflater.from(context).inflate(getItemViewLayoutId(), parent, false);
        ViewHolder holder = new FlashSaleViewHolder(context, itemView);
        return holder;
    }

    private final class FlashSaleViewHolder extends ViewHolder {
        public FlashSaleViewHolder(Context context, View itemView) {
            super(context, itemView);
            ItemFlashSaleView itemFlashSaleView = (ItemFlashSaleView) itemView.findViewById(R.id.item_flash_sale);

        }
    }

    @Override
    public void updateData(ItemFlashSaleData itemFlashSaleData) {

    }

    @Override
    public int getItemCount() {
        return 1;
    }
}
